package com.dingxin.ship_together_api;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dingxin.ship_together_api.entity.RouteTime;
import com.dingxin.ship_together_api.mapper.*;
import com.dingxin.ship_together_api.service.OrderContactsService;
import com.dingxin.ship_together_api.service.OrderInfoService;
import com.dingxin.ship_together_api.service.RouteSeatService;
import com.dingxin.ship_together_api.service.ShipInfoService;
import com.dingxin.ship_together_api.service.impl.OrderInfoServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * Author: ctj
 * Date: 2022-08-09
 * Time: 14:38
 */
@Slf4j
@SpringBootTest public class mappertest {

    @Autowired private SysUserMapper sysUserMapper;
    @Autowired private OrderInfoMapper orderInfoMapper;
    @Autowired private OrderInfoService orderInfoService;
    @Autowired private ShipInfoMapper shipInfoMapper;
    @Autowired private OrderContactsService orderContactsService;
    @Autowired private ShipInfoService shipInfoService;
    @Autowired private RouteSeatMapper routeSeatMapper;
    @Autowired private RouteSeatService     routeSeatService;
    @Autowired private RouteTimeMapper    timeMapper;
    @Autowired private OrderInfoServiceImpl orderInfoServiceImpl;

    @Test
    public void CreateOrder(){
        DateTime date = DateUtil.date();
        List<RouteTime> routeTimes = timeMapper.selectList(
            new QueryWrapper<RouteTime>().between(RouteTime.COL_END_TIME, date, DateUtil.offsetDay(date, 1))
                .between(RouteTime.COL_START_TIME, date, DateUtil.offsetDay(date, 1)));
        System.out.println("routeTimes = " + routeTimes);
    }
}
